import http from "@/common/http/request"
import { songAddInterface, songCheckListInterface, songListInterface, songUpdateInterface } from "./songList.interface";

//歌曲列表
export const $songList = (data: songListInterface) => {
  const $http = new http();
  return $http.get({
    url: '/piano/song/list',
    data,
  })
}

//歌曲列表下拉框
export const $songCheckList = (data: songCheckListInterface) => {
  const $http = new http();
  return $http.get({
    url: '/piano/song/checkList',
    data,
  })
}

//歌曲详情
export const $songDetail = (data: string) => {
  const $http = new http();
  return $http.get({
    url: `/piano/song/${data}`,
  })
}

//新增歌曲
export const $songAdd = (data: songAddInterface) => {
  const $http = new http();
  return $http.post({
    url: `/piano/song`,
    data,
  })
}

//更新歌曲
export const $songUpdate = (data: songUpdateInterface) => {
  const $http = new http();
  return $http.put({
    url: `/piano/song`,
    data,
  })
}

//删除分类
export const $songDelete = (data: Array<string>) => {
  const $http = new http();
  return $http.delete({
    url: `/piano/song/${data.join(',')}`,
  })
}
